﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.Collections;

namespace SchemaMonitor.json
{
    [DataContract]
    public class CFieldInt : CField
    {
        //Members
        [DataMember(Order = 1)]
        public List<int> Ints;

        //Constructor
        public CFieldInt(CNodeBasic parent, CTag tag, object value) : base(parent, tag)
        {
            this.Value = value;

        }
        //Serialisation Constructors
        private CFieldInt() { }
        static CFieldInt() { ProtoBuf.Serializer.PrepareSerializer<CFieldInt>(); }

        //Must Override
        public override IList List { get { return Ints; } set { Ints = value.Cast<int>().ToList(); } }
        protected override IList InitList() { return new List<int>(); }
        protected override IList InitList(object[] array) { return array.Cast<int>().ToList(); }

    }
}
